//
//  JSQMapLocation.m
//  Conversation
//
//  Created by C_HAO on 15/10/14.
//  Copyright © 2015年 CHAOO. All rights reserved.
//

#import "JSQMapLocation.h"

@implementation JSQMapLocation

- (NSString *)title {
    NSString *ret = [NSString string];
    if (_addressTitle) {
        ret = _addressTitle;
    }
    return ret;
}

- (NSString *)subtitle {
    NSMutableString *ret = [NSMutableString string];
    if (_streetAddress)
        [ret appendString:_streetAddress];
    return ret;
}

- (void)encodeWithCoder:(NSCoder *)aCoder {
    [aCoder encodeObject:_streetAddress forKey:@"streetAddress"];
    [aCoder encodeObject:_addressTitle forKey:@"addressTitle"];
}

- (id)initWithCoder:(NSCoder *)aDecoder {
    self = [super init];
    if (self) {
        self.streetAddress = [aDecoder decodeObjectForKey:@"streetAddress"];
        self.addressTitle = [aDecoder decodeObjectForKey:@"addressTitle"];
    }
    return self;
}

@end
